<template>
  <div id="talentId">
    <div>
      <div class="divone">
        <span class="span01">普通工人</span>
      </div>
      <div class="buttonspan">
        <el-button>
          <span>{{ approval01 }}</span>
        </el-button>
      </div>
      <div class="divthree">
        <span class="manzulv">满足率/%</span>
      </div>
      <div class="divinput">
        <el-input size="biger" v-model="input" type="text"></el-input>
      </div>
      <div class="divfour">
        <el-select size="big" v-model="ordinaryValue" placeholder="请选择">
          <el-option
              v-for="item in ordinaryOptions"
              :key="item.ordinaryValue"
              :label="item.ordinaryLabel"
              :value="item.ordinaryValue">
          </el-option>
        </el-select>
      </div>
      <div>
        <div class="biandongDiv">
          <span class="biandongyuanying">变动原因</span>
        </div>
        <div class="textareaDiv">
          <el-input v-model="ordinaryTextarea" placeholder="请输入内容"></el-input>
        </div>
      </div>
    </div>

    <div>
      <div class="divjishu">
        <span class="span01">技术人才</span>
      </div>
      <div class="buttonspan">
        <el-button>
          <span>{{ approval02 }}</span>
        </el-button>
      </div>
      <div class="divthree">
        <span class="manzulv">满足率/%</span>
      </div>
      <div class="divinput">
        <el-input size="biger" v-model="Talentedinput" type="text"></el-input>
      </div>
      <div class="divfour">
        <el-select size="big" v-model="TalentedValue" placeholder="请选择">
          <el-option
              v-for="item in TalentedOptions"
              :key="item.TalentedValue"
              :label="item.TalentedLabel"
              :value="item.TalentedValue">
          </el-option>
        </el-select>
      </div>
      <div>
        <div class="biandongDiv">
          <span class="biandongyuanying">变动原因</span>
        </div>
        <div class="textareaDiv">
          <el-input v-model="TalentedTextarea" placeholder="请输入内容"></el-input>
        </div>
      </div>
    </div>

    <div>
      <div class="divjishu">
        <span class="span01">高端人才</span>
      </div>
      <div class="buttonspan">
        <el-button>
          <span>{{approval03}}</span>
        </el-button>
      </div>
      <div class="divthree">
        <span class="manzulv">满足率/%</span>
      </div>
      <div class="divinput">
        <el-input size="biger" v-model="HighInput" type="text"></el-input>
      </div>
      <div class="divfour">
        <el-select size="big" v-model="highValue" placeholder="请选择">
          <el-option
              v-for="item in highOptions"
              :key="item.highValue"
              :label="item.highLabel"
              :value="item.highValue">
          </el-option>
        </el-select>
      </div>
      <div>
        <div class="biandongDiv">
          <span class="biandongyuanying">变动原因</span>
        </div>
        <div class="textareaDiv">
          <el-input v-model="highTextarea" placeholder="请输入内容"></el-input>
        </div>
      </div>
    </div>

    <div>
      <div class="divjishu">
        <span class="spanjixu">急需人员情况</span>
      </div>
      <div class="buttonspan">
        <el-button>
          <span>{{ approval04 }}</span>
        </el-button>
      </div>
      <div class="divthree">
        <span class="renyuanquekou">人员缺口类型</span>
      </div>
      <div class="divselect">
        <el-select size="big" v-model="talenttype" placeholder="请选择" style="width: 260px;">
          <el-option
              v-for="item in needOptions"
              :key="item.id"
              :label="item.talenttype"
              :value="item.id">
          </el-option>
        </el-select>
      </div>
      <div>
        <div class="Div">
          <span class="biandongyuanying">急需人才数量</span>
        </div>
        <div class="textareaDiv">
          <el-input v-model="needTextarea" placeholder="请输入内容"></el-input>
        </div>
      </div>
    </div>

    <div class="buttondiv">
      <el-button type="primary" @click="jump">情况新增</el-button>
      <el-button type="primary" @click="jumpUpdate">情况修改</el-button>
      <el-button type="primary" @click="jumpHistory">历史记录</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: "Talent",
  data(){
    return{
      input: "",
      ordinaryTextarea: "",
      Talentedinput:"",
      TalentedTextarea:"",
      HighInput:"",
      highTextarea:"",
      needTextarea:"",
      talenttype:"",
      approval01:"",
      approval02:"",
      approval03:"",
      approval04:"",
      changereason: "",
      ordinaryOptions:[{
        ordinaryValue: '选项1',
        ordinaryLabel: '上升'
      }, {
        ordinaryValue: '选项2',
        ordinaryLabel: '下降'
      }, {
        ordinaryValue: '选项3',
        ordinaryLabel: '不变'
      }],
      ordinaryValue: "",
      TalentedOptions:[{
        TalentedValue: '选项1',
        TalentedLabel: '上升'
      }, {
        TalentedValue: '选项2',
        TalentedLabel: '下降'
      }, {
        TalentedValue: '选项3',
        TalentedLabel: '不变'
      }],
      TalentedValue:"",
      highOptions:[{
        highValue: '选项1',
        highLabel: '上升'
      }, {
        highValue: '选项2',
        highLabel: '下降'
      }, {
        highValue: '选项3',
        highLabel: '不变'
      }],
      highValue:"",
      needOptions:[],
    }
  },
  methods:{
    jump(){
      this.$router.push("/talentAdd")
    },
    jumpUpdate(){
      this.$router.push("/talentUpdate")
    },
    jumpHistory(){
      this.$router.push("/talentHistory")
    }
  },
  created() {
    const _this = this
    axios.get('http://localhost:8081/talent/talentselect').then(function (resp){
      _this.needOptions = resp.data
    })
    axios.get('http://localhost:8081/talent/ordinarys/1').then(function (resp){
      _this.input = resp.data.satisfy
      _this.ordinaryTextarea = resp.data.changereason
      _this.approval01 = resp.data.type
      _this.ordinaryValue = resp.data.shift
    })
    axios.get('http://localhost:8081/talent/ordinarys/2').then(function (resp){
      _this.Talentedinput = resp.data.satisfy
      _this.TalentedTextarea = resp.data.changereason
      _this.approval02 = resp.data.type
      _this.TalentedValue = resp.data.shift
    })
    axios.get('http://localhost:8081/talent/ordinarys/3').then(function (resp){
      _this.HighInput = resp.data.satisfy
      _this.highTextarea = resp.data.changereason
      _this.approval03 = resp.data.type
      _this.highValue = resp.data.shift
    })
    axios.get('http://localhost:8081/talent/ordinarys/4').then(function (resp){
      _this.talenttype = resp.data.need
      _this.needTextarea = resp.data.quantity
      _this.approval04 = resp.data.type
    })

  }
}
</script>

<style scoped>
  .divone{
    border-bottom: #eaeaea solid 0.25px;
    line-height: 35px;
    margin-left: -20px;
  }
  .span01{
    font-size: 16px;
    font-weight: bolder;
    color: blue;
    margin-left: 30px;
  }
  .divthree{
    width: 140px;
    height: 45px;
    background-color: deepskyblue;
    float: left;
    margin-left: -20px;
    margin-top: 15px;
  }
  .manzulv{
    position: absolute;
    padding-top: 11px;
    padding-left: 30px;
    font-size: 16px;
    font-weight: bolder;
    color: white;
  }
  .divinput{
    float: left;
    margin-top: 18px;
    height: 15px;
    width: 120px;
  }
  .divfour{
    margin-top: 18px;
    width: 140px;
    float: left;
  }
  .biandongDiv{
    width: 140px;
    height: 40px;
    background-color: deepskyblue;
    margin-left: 200px;
    margin-top: 18px;
    float: left;
  }
  .biandongyuanying{
    position: absolute;
    font-size: 16px;
    font-weight: bolder;
    color: white;
    padding-left: 35px;
    padding-top: 7px;
  }
  .textareaDiv{
    float: left;
    margin-top: 18px;
  }
  .divjishu{
    margin-top: 100px;
    border-bottom: #eaeaea solid 0.25px;
    margin-left: -20px;
    line-height: 35px;
  }
  .spanjixu{
    font-size: 16px;
    font-weight: bolder;
    color: blue;
    margin-left: 15px;
  }
  .renyuanquekou{
    position: absolute;
    padding-top: 11px;
    padding-left: 15px;
    font-size: 16px;
    font-weight: bolder;
    color: white;
  }
  .divselect{
    margin-top: 18px;
    width: 300px;
    float: left;
  }
  .selecone{
    width: 500px;
  }
  .Div{
    width: 140px;
    height: 40px;
    background-color: deepskyblue;
    margin-left: 162px;
    margin-top: 18px;
    float: left;
  }
  .buttondiv{
    margin-top: 100px;
    margin-left: -20px;
  }
  .buttonspan{
    margin-top: -40px;
    margin-left: 120px;
  }
  #talentId{
    margin-top: 20px;
    margin-left: 20px;
  }
</style>